package com.Shop.beans;

///*
// * To change this license header, choose License Headers in Project Properties.
// * To change this template file, choose Tools | Templates
// * and open the template in the editor.
// */
//package com.etop.odbs.beans;
//
//import java.io.IOException;
//import javax.servlet.Filter;
//import javax.servlet.FilterChain;
//import javax.servlet.FilterConfig;
//import javax.servlet.ServletException;
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//
///**
// *
// * @author shilin
// */
//public class SystemContextFilter implements Filter{
//
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
//    }
//
//    @Override
//    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
//        int offset = 0;
//        try{
//        offset = Integer.parseInt(req.getParameter("pager.offset"));
//        }catch(NumberFormatException e){  
//        }
//        try{
//            SystemContext.setOffset(offset);
//            SystemContext.setSize(10);
//            chain.doFilter(req, resp);
//        }finally{
//            SystemContext.removeOffset();
//            SystemContext.removeSize();
//        }
//    }
//
//    @Override
//    public void destroy() {
//        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
//    }
//    
//}
